<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page errorPage="erro.jsp" %>
<%!
	
	String foo(){
		System.out.println("call foo");
		return "foo() web";
 }
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
	int i=100;
	System.out.println("i="+i);
	int x=0;
	int j=100/x;
%>
<%! int k=100; %>
<h1><%=i+100 %></h1>
<h1><%=foo() %></h1>
<h1><%=foo() %></h1>
</body>
</html>